﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Cn.Edwon.Web.Support;
using Cn.Cellula.Model.Security;
using Cn.Edwon.Web.Script;
using Cn.Edwon.Spring;
using Cn.Cellula.Biz.Port;

namespace Cn.Cellula.MiniTopSite.Ws {
    public partial class _User : PageSupport {
        IUserBiz biz = BizFactory.Get<IUserBiz>();
        protected void Page_Load(object sender, EventArgs e) {
            ResponseOut(LoadLowerUser());
        }
        private void ResponseOut(String content) {
            Response.Clear();
            Response.Write(content);
        }
        private String LoadLowerUser() {
            if (base.Actor == null) {
                return "[]";
            } else {
                IList<VSysUserEO> list = biz.LoadLowerUser(base.Actor.ID, base.Actor.Power, (Request.QueryString["self"] == "1"));
                return JsUtil.ParseEOList2Array<VSysUserEO>(list, "UserKey,UserName,DeptName,Duty");
            }
        }
    }
}